<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	<title>登录 - ${siteName}</title>
	<meta name="description" content="">
	<meta name="author" content="xuzewei">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
	<link rel="stylesheet" type="text/css" href="css/cloud-admin.css" >
	<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<!-- DATE RANGE PICKER -->
	<link rel="stylesheet" type="text/css" href="js/bootstrap-daterangepicker/daterangepicker-bs3.css" />
	<!-- UNIFORM -->
	<link rel="stylesheet" type="text/css" href="js/uniform/css/uniform.default.min.css" />
	<!-- ANIMATE -->
	<link rel="stylesheet" type="text/css" href="css/animatecss/animate.min.css" />
	<!-- HUBSPOT MESSENGER -->
	<link rel="stylesheet" type="text/css" href="js/hubspot-messenger/css/messenger.min.css" />
	<link rel="stylesheet" type="text/css" href="js/hubspot-messenger/css/messenger-theme-flat.min.css" />
</head>
<body class="login" id="loginApp" ng-app="loginApp" ng-controller="loginCtrl">	
	<!-- PAGE -->
	<section id="page">
			<!-- LOGIN -->
			<section id="login" class="visible">
				<div class="container">
					<div class="row">
						<div class="col-md-4 col-md-offset-4">
							<div class="login-box-plain">
								<h2 class="bigintro">登录</h2>
								<div class="divide-40"></div>
								<form role="form">
									<div class="form-group">
									  <label>孵化器</label>
									  <select ng-model="allianceMember" class="form-control" ng-options="o.memberId as o.name for o in allianceMemberList">
									  	<option value="">-- 请选择孵化器 --</option>
									  </select>
									</div>
								  <div class="form-group">
									<label for="exampleInputEmail1">账号</label>
									<i class="fa fa-user"></i>
									<input type="text" class="form-control" ng-model="account">
								  </div>
								  <div class="form-group"> 
									<label for="exampleInputPassword1">密码</label>
									<i class="fa fa-lock"></i>
									<input type="password" class="form-control" id="exampleInputPassword1" ng-model="password">
								  </div>
								  <div class="form-actions">
									<button id="submit" type="submit" class="btn btn-danger" ng-click="login()">登录</button>
								  </div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</section>
			<!--/LOGIN -->
	</section>
	<!--/PAGE -->
	<!-- JAVASCRIPTS -->
	<!-- Placed at the end of the document so the pages load faster -->
	<!-- JQUERY -->
	<script src="js/jquery/jquery-2.0.3.min.js"></script>
	<!-- JQUERY UI-->
	<script src="js/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"></script>
	<!-- BOOTSTRAP -->
	<script src="bootstrap-dist/js/bootstrap.min.js"></script>
	<!-- UNIFORM -->
	<script type="text/javascript" src="js/uniform/jquery.uniform.min.js"></script>
	<!-- SLIMSCROLL -->
	<script type="text/javascript" src="js/jQuery-slimScroll-1.3.0/jquery.slimscroll.min.js"></script>
	<script type="text/javascript" src="js/jQuery-slimScroll-1.3.0/slimScrollHorizontal.min.js"></script>
	<!-- BLOCK UI -->
	<script type="text/javascript" src="js/jQuery-BlockUI/jquery.blockUI.min.js"></script>
	<!-- HUBSPOT MESSENGER -->
	<script type="text/javascript" src="js/hubspot-messenger/js/messenger.min.js"></script>
	<script type="text/javascript" src="js/hubspot-messenger/js/messenger-theme-flat.js"></script>
	<script type="text/javascript" src="js/hubspot-messenger/js/messenger-theme-future.js"></script>
	<!-- COOKIE -->
	<script type="text/javascript" src="js/jQuery-Cookie/jquery.cookie.min.js"></script>
	<!-- CLOSURE-LIBRARY -->
	<script src="closure-library/closure/goog/base.js"></script>
	<!-- ANGULAR-LIBRARY -->
	<script src="angular-1.5.0-rc.2/angular.js"></script>
	<script src="include/common.js"></script>
	<script>
	var loginApp = angular.module("loginApp", []);
	loginApp.controller('loginCtrl', function($scope, $http, $httpParamSerializer, $injector, $window) {
		$scope.login = function() {
			var param = {
				"account": $scope.account,
				"password": $scope.password,
				"allianceMember": $scope.allianceMember
			};
			jQuery.post("api/login", param, function(data) {
				if (isErr(data)) {
					showErrMsg(data);
					return;
				}
				$window.location.href = "welcome.jsp";
			});
		}
		
		$scope.queryAllAllianceMember = function() {
			var reqDate = jQuery.param({
				"pageSize": 1000,
				"pageIndex": 0
			});
			var reqConfig = { headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"} };
			$http.post(
				"api/platformAllianceMember/list", reqDate, reqConfig
			).success(function(data, status) {
				if (isErr(data)) {
					showErrMsg(data);
					return;
				}
				$scope.allianceMemberList = data.response.list;
			}).error(function(data, status) {
				showNetworkErrMsg(data, status);
			});
		}
	});
	</script>
	<script>
	jQuery(document).ready(function() {
		setTimeout(function () { angular.element('#loginApp').scope().queryAllAllianceMember(); }, 500);
	});
	</script>
	<!-- /JAVASCRIPTS -->
</body>
</html>